<template>
	<page  ref='page' top='100rpx'>
		<!-- 首页 wwl-->
		<view class="page">
			<view class="tabber_box">
				<view class="tabber_box_static" :style="{ height: `${getters.statusBarHeight}px` }"></view>
				<view class="tabber_box_flex" :style="{ height: `${getters.statusBarHeight}px` }"></view>
			</view>
			<view class="tabber_box_title_static">
			</view>
			<view class="tabber_box_title_flex" :style="{ top: `${getters.statusBarHeight}px` }">
				<!-- <view class="left" @click="onChat()">
					<image src="../../static/image/icon/news01.png" mode="scaleToFill"></image>
					<text class="icon" v-if="getters.chat_unread"></text>
				</view> -->
				<view class="text">
					来鑫小区管理
				</view>
			</view>
			<view class="" style="padding: 10px 10px;">
				<!-- <home-swiper :swiperList='bannerList' autoplay v-if='bannerList && bannerList.length > 0' /> -->
				<swiper class="banner"  circular autoplay  interval="4000" duration="1000"
					indicator-active-color='#d5d5d5' indicator-color='#999' indicator-dots>
					<swiper-item v-for="(item,index) in bannerList" :key='index' @click="gotoIndexOne(item,index)">
						<view class="swiper_item">
							<image :src="item.pic_url" mode="scaleToFill" :data-index="index" class="imagebanner"></image>
						</view>
					</swiper-item>
				</swiper>
			</view>
			
			<view class="quick_box3">
				<view class="row" v-for='(item,index) in quickList' :key='index' @click="quickClick(item)">
					<image :src="item.img" mode="scaleToFill" ></image>
					<text>{{item.name}}</text>
				</view>
			</view>
			
			<view class="quick_box1">
				<view class="row" @tap="onFangketz()">
					<view class="left">
						<image src="https://xiaoqu.wuguoxin.vip/uploads/web/fangkedengji.png" mode="scaleToFill"></image>
					</view>
					<view class="right">
						<text>访客/车辆登记</text>
						<text>亲朋好友上门登记</text>
					</view>
					<!-- <view class="right">
						<text>设计案例</text>
						<text>了解前沿设计</text>
					</view> -->
				</view>
				<view class="row" @click="onConstructionSite()">
					<view class="left">
						<image src="https://xiaoqu.wuguoxin.vip/uploads/web/guzhangbaoxiu.png" mode="scaleToFill"></image>
					</view>
					<view class="right">
						<text>故障报修</text>
						<text>小区故障上报</text>
					</view>
					<!-- <view class="right">
						<text>工地现场</text>
						<text>查看在线工地</text>
					</view> -->
				</view>
			</view>
			
			<view class="xiaoqugonggao">
				<view class="top">
					<n-icon name="newfill" size="40rpx" color="#f15723"></n-icon>
					小区公告
				</view>
				<view class="bottom">
					<view class="list" v-if="recommendList.length > 0 ">
						<view class="row" v-for="(item,index) in recommendList" :key="index" @click="gotoDetail(item.id)">
							<view class="left">
								<view class="">
									{{item.title}}
								</view>
								<view class="">
									{{item.label}}
								</view>
								<view class="">
									<image src="https://xiaoqu.wuguoxin.vip/uploads/web/ZbR1Yj4NNP4VKOdAB2eGJavDG0rck7UOqKroJemp.png" mode="scaleToFill"></image>
									<text>{{item.look_num}}</text>
								</view>
							</view>
							<image :src="item.img" mode="scaleToFill" class="right"></image>
						</view>
					</view>
					<empty :text="house_status == 0 ? '暂无公告' : '业主认证后获取'" status="2" v-else/>
				</view>
			</view>
			
			
			
			<foot />
			<tabbar ref='tabbar' />
			<!-- <u-popup v-model:value="integral.visible" mode='center' @close='changeIntegral()'>
				<view class="reject_popup2">
					<image src="http://tuzhuang-1304727035.file.myqcloud.com/20211109/HWCfYjUIUg994QRxznRu6aTDpj4W91JrxUwsSH9V.png" mode="scaleToFill" @click="onDecorationGold()" class="image"></image>
					<image src="http://tuzhuang-1304727035.file.myqcloud.com/20211213/GY5DtSDZdjKiqO8SCw05GmtWrQpObbvOU7jFdly9.png" mode="scaleToFill" class="icon"
						@click="changeIntegral()"></image>
				</view>
			</u-popup> -->
		</view>
	</page>
</template>

<script>
	import uPopup from '@/components/u-popup.vue'
	import tabbar from '@/components/tabbar.vue'
	import tabRow2 from '@/components/tab-row2.vue'
	
	import vgtTab from '@/components/vgt-tab/vgt-tab.vue'
	
	import renovationRow from '@/components/renovation-row.vue'
	import  renovationShop  from "@/components/renovation-shop.vue"
	// import {
	// 	getCityName
	// } from "../../utils/getRequest.js"
	
	import {
		setUserInfo
	} from '@/utils/postRequest.js'
	import {
		getJCCGoodsNav,
		getJCCGoodsList,
		getDGGoodsList,
		getShopList,
		getbuildingMaterialsCityType,getbuildingMaterialsCitysGoodsList,getCityName,
		getHomeCarousel,
		getHometellAbout,
		getDesignNav,
		getHomeFindInspiration,
		getFindDesignshopList,
		getFindCraftsman,
		commonGetConfig,
		getStandard
	} from '@/utils/getRequest.js'
	export default {
		components: {
			vgtTab,
			tabbar,
			uPopup,
			tabRow2,
			renovationRow,
			renovationShop
		},
		data() {
			return {
				tabList:[],
				
				vgtTab: [],
				findlist: [],
				tabActive:0,
				tabActive_xin:1,
				duihuan:0,
				type:'',
				classificationList:[],
				classificationLists:[],
				have_tell:1,    //1：隐藏，  2：显示
				have_idea:1,    //1：隐藏，  2：显示
				integral: {
					visible: true,
				},
				activeTab: 0,
				homeTopBgc: "rgba(0,0,0,0.2)",
				isReachBottom: 0,
				controls: false,
				bannerActive: 0,
				bannerTime: null,
				bannerList: [],
				designshoption: {
					list: [],
					total: 0,
					page: 1,
					title:'',
					isFocus:false,
					activeId:0,
					offer:0,
					source:0,
					limit: 27,
					loading: false,
					heightList: [0, 0],
				},
				craftsmanshoption: {
					list: [],
					total: 0,
					page: 1,
					offer:0,
					source:0,
					title:'',
					isFocus:false,
					limit: 27,
					loading: false,
					heightList: [0, 0],
				},
				buildingshoption: {
					list: [],
					total: 0,
					page: 1,
					limit: 27,
					offer:0,
					loading: false,
					heightList: [0, 0],
				},
				jiancaicquickList:[],
				dangqiandingshoption: {
					list: [],
					total: 0,
					page: 1,
					limit: 27,
					offer:0,
					loading: false,
					heightList: [0, 0],
				},
				findInspiration: {
					list: [],
					total: 0,
					page: 1,
					limit: 10,
					loading: false,
					heightList: [0, 0],
				},
				quickList: [{
						img: 'https://xiaoqu.wuguoxin.vip/uploads/appimg/indextb3.png',
						name: '生活缴费',
						// url: '/pagesHome/workmanship',
						url: '/pagesMy/livingexpenses/index',
						
					},
					{
						img: 'https://xiaoqu.wuguoxin.vip/uploads/appimg/indextb4.png',
						name: '业主认证',
						url: '/pagesMy/housingArchives/index?type=choice'
					},
					{
						img: 'https://xiaoqu.wuguoxin.vip/uploads/appimg/indextb1.png',
						name: '分享邀请',
						url: '/pagesMy/posters'
					},
					{
						img: 'https://xiaoqu.wuguoxin.vip/uploads/appimg/indextb2.png',
						name: '投票签名',
						url: '/pagesMy/vote/index'
					}
				],
				more: false,
				tellAboutList: [],
				page: 1,
				limit: 10,
				total:0,
				loading: false,
				recommendList:[],//小区公告
				residentialquarters_id:0,
				residentialquarters_name:'默认小区',
				house_status:0,
			}
		},
		onReachBottom(x) {
			// if (this.findInspiration.page * this.findInspiration.limit >= this.findInspiration.total || this
			// 	.findInspiration.loading) return
			// this.findInspiration.page++
			// this.getFindInspiration()
			
			if (this.page * this.limit >= this.total || this.loading) return
			this.page++
			this.getStandard()
			// this.getFindInspiration()
		},
		onPullDownRefresh(){
			this.onGetBannerList()
			// this.getTellAboutList()
			this.findInspiration.page = 1
			// this.getFindInspiration()
		},
		methods: {
			//跳转公告详情
			gotoDetail(id) {
				uni.navigateTo({
					url: `/pagesHome/Processdetails?id=${id}`
				});
			},
			//获取公告
			getStandard(){
				uni.showLoading({
					title: '加载中...'
				});
				getStandard({nav_id:3,page:this.page,limit:this.limit}).then(res=>{
					let arr = res && res.list.map((item,index)=>{
						return {
							id: item.id,
							title:item.title,
							label:item.title_aux,
							img:item.picture,
							look_num:item.look_num
						} 
					})
					console.log(arr,'小区公共获取')
					if(this.page>1){
						this.recommendList = this.recommendList.concat(arr);
					}else{
						this.recommendList = arr;
					}
					// if(res.list && res.list.length < 10 ){
					// 	this.more = true;
					// }
					uni.hideLoading();
				})
			},
			onShop(row,status){
				console.log(row, '传过来的数据');
				if(status == 3){
					// 跳转到店铺
					uni.navigateTo({
						url:`/pagesCommodity/shopDetailsDefault?id=${row.id}&name=${encodeURIComponent(row.name)}&offer=0&source=0&duihuan=0&shouquan=0&yunshop=0`
					})
				}else{
					var type = 'findDesign';
					if(status == 1){
						var type = 'findDesign';
					}else if(status == 2){
						var type = 'findCraftsman';
					}
					uni.navigateTo({
						url:`/pagesCommodity/shopDetailsDefault?type=${type}&id=${row.id}&name=${encodeURIComponent(row.name)}&source=0&offer=0&duihuan=0&shouquan=0&yunshop=0`
					})
				}
			},
			//获取建材城商品
			async getList(){
					this.buildingshoption.loading = true;
					if(this.buildingshoption.page == 1) uni.showLoading() 
					
							var res = await getShopList({
								jiancai:1,
								page:this.buildingshoption.page,limit:this.buildingshoption.limit,
								zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : '',
								user_id: this.buildingshoption.offer == 2  && this.$store.state.chat_to ? this.$store.state.chat_to.id : ''
							})
					// }
					this.buildingshoption.list =  this.buildingshoption.page == 1 ? res.list : [...this.buildingshoption.list,...res.list];
					console.log(this.buildingshoption.list, '商品列表');
					this.buildingshoption.total = res.count
					this.buildingshoption.loading = false
					
					// if(res.shopcount < 1){
					// 	uni.showToast({title:'您的档案地址服务商家不足1个，已为您展示其他服务商家',icon:'none',duration:2000})
					// }
					
					if(this.buildingshoption.page == 1) uni.hideLoading() 
				
			},
			//获取建材城活动
			async getClassificationList(){
				if(this.buildingshoption.page == 1)  uni.showLoading()
				this.buildingshoption.loading = true
				try{
					console.log(this.tabActive, '分类点击');
					if(this.tabActive == 0){
						this.getList()
					}else if(this.tabActive == 1){
						console.log(this.tabActive, '分类点击啊 ');
						var res = await getDGGoodsList({page:this.buildingshoption.page,limit:this.buildingshoption.limit,jiancai:1,zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : ''})
						
							var list = this.buildingshoption.page == 1 ?  res.list : [...this.classificationList,...res.list];
							// this.classificationLists  = 
							this.classificationList  = list;
							console.log(res,'兑换前');
					}else{
						var res = await getJCCGoodsList({page:this.buildingshoption.page,limit:this.buildingshoption.limit,zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : '',type:this.tabActive})
						var list = this.buildingshoption.page == 1 ?  res.list : [...this.classificationList,...res.list];
						
						this.classificationList  = list;
					}
					
					
					
					
					
					this.buildingshoption.total = res.count
					this.buildingshoption.loading = false
					
					if(this.buildingshoption.page == 1)  uni.hideLoading()
					uni.stopPullDownRefresh()
				}catch{
					uni.hideLoading()
					this.buildingshoption.loading = false
					uni.stopPullDownRefresh()
				}
			},
			//获取建材城内各个店铺或者活动的商品
			changeTabs(c){
				this.tabActive = c
				
				this.buildingshoption.page = 1
				console.log(c,'分类点击爱上的发生短发');
				if(c == 0){
					this.getList()
				}else{
					this.getClassificationList()
				}
			    
			},
			//切换设计工匠等
			changeTabs_xin(c){
				// if(c != 0){
				// 	this.tabActive = c-1
				// }else{
					this.tabActive_xin = c
				// }
				
				this.dangqiandingshoption.page = 1
				console.log(c,'切换设计工匠等');
				
				if(c == 1){
					// this.$refs.tabsxin.active = 1
				}else if(c == 2){
					// this.$refs.tabsxin.active = 2
				}else if(c == 3){
					this.getTabList()
					// this.$refs.tabsxin.active = 3
				}else if(c == 4){
					// this.$refs.tabsxin.active = 4
				}
			    
			},
			//建材城分类跳转
			onTypePage(name,id){
				
				uni.navigateTo({
					url:`/pagesCommodity/classification?type=${id}&typeName=${encodeURIComponent(name)}&jiacan=1`
				})
			},
			//建材城各个馆跳转
			onTypePagebsb(type){
				if(type == 1){
					uni.navigateTo({
						url:`/pagesCommodity/buildingMaterialsCity/brand`
					})
				}else if(type == 2){
					uni.navigateTo({
						url:`/pagesCommodity/buildingMaterialsCity/soft_decoration`
					})
				}else if(type == 3){
					uni.navigateTo({
						url:`/pagesCommodity/buildingMaterialsCity/base_material`
					})
				}
				
			},
			//获取建材城分类
			async getTabList(){
				
				try{console.log('分类1');
					var res = await getJCCGoodsNav()
					// var res = await getJCCGoodsNav({status:1})
					console.log(res,'分类');
					// res.unshift(["id":0,"name":'建材城']);
					
					this.tabList = res
					this.$refs.tabs.active = 0
					
					
					
					var resf = await getbuildingMaterialsCityType()
					this.jiancaicquickList = resf
					
					this.changeTabs(0)
					
					// this.getList()
				}catch{}
			},
			
			async onGetBannerLists() {
				console.log('阿斯达 ');
				this.getTabList()
				
				
			},
			//设计师搜索
			onSearch(){
				this.designshoption.page = 1
				this.FindDesignshop()
			},
			//设计师分类搜索
			vgtChange(e) {
				this.designshoption.activeId = e.currentInd;
				this.designshoption.page = 1
				this.FindDesignshop()
			},
			//获取设计师分类
			async getTabFindDesignList() {
				try {
					var res = await getDesignNav()
					this.vgtTab = [{
						name: '全部',
						id: 0
					}, ...res]
					this.FindDesignshop()
				} catch {}
			},
			//获取设计师店铺
			async FindDesignshop() {
				this.designshoption.loading = true
				if(this.designshoption.page == 1) uni.showLoading()
				try {
					var res = await getFindDesignshopList({
						page: this.designshoption.page,
						limit: this.designshoption.limit,
						build_city_id: this.$store.state.addressSelect ? this.$store.state.addressSelect.id :
							null,
						build_city_nav_id: this.designshoption.activeId,
						zone_id:this.getters.addressSelect ? this.getters.addressSelect.id : '',
						title: this.designshoption.title ? this.designshoption.title.trim() :  '',
						user_id: this.designshoption.offer == 2  && this.$store.state.chat_to ? this.$store.state.chat_to.id : ''
					})
					
					
					this.designshoption.list = this.designshoption.page == 1 ? res.list : [...this.designshoption.list, ...res.list],
					
					
					
					// console.log(res,'首页设计师');
					// this.designshoption.list = res.list;
					// // this.designshoption.list = res.list
					// var data = this.designshoption.list
					// var list = []
					// 						//一次显示3个
					// for (var i = 0, len = data.length; i < len; i += 2) {
					// 	list.push(data.slice(i, i + 2));
					// }
					// this.designshoption.list=[]
					// for(var j=0;j<list.length;j++){
					// 	this.designshoption.list.push(list[j])
					// }
					console.log(this.designshoption.list,'二次变异');
					
					
					
					
					this.designshoption.total = res.count
					this.designshoption.loading = false
					
					if(res.shopcount < 1){
						// uni.showToast({title:'您的档案地址服务商家不足1个，已为您展示其他服务商家',icon:'none',duration:2000})
					}
					
					if(this.designshoption.page == 1) uni.hideLoading()
					uni.stopPullDownRefresh()
					
				} catch {
					this.designshoption.loading = false
					uni.hideLoading()
					uni.stopPullDownRefresh()
				}
			},
			
			//工长店铺搜索
			onSearchfindcraftsman(){
				this.craftsmanshoption.page = 1
				this.FindCraftsmanshop()
			},
			//获取工长店铺
			async FindCraftsmanshop() {
				this.craftsmanshoption.loading = true
				if(this.craftsmanshoption.page == 1) uni.showLoading()
				try {
					var res = await getFindCraftsman({
						page: this.craftsmanshoption.page,
						limit: this.craftsmanshoption.limit,
						title: this.craftsmanshoption.title ? this.craftsmanshoption.title.trim() : '' ,
						zone_id:this.getters.addressSelect ? this.getters.addressSelect.id : '',
						build_city_id: this.$store.state.addressSelect ? this.$store.state.addressSelect.id :
							'',
						user_id: this.craftsmanshoption.offer == 2  && this.$store.state.chat_to ? this.$store.state.chat_to.id : ''
					})
					
					
					console.log(res,'首页工长');
					this.craftsmanshoption.list = this.craftsmanshoption.page == 1 ? res.list : [...this.craftsmanshoption.list, ...res.list];
					// var data = this.craftsmanshoption.list
					// var list = []
					// 						//一次显示3个
					// for (var i = 0, len = data.length; i < len; i += 2) {
					// 	list.push(data.slice(i, i + 2));
					// }
					// this.craftsmanshoption.list=[]
					// for(var j=0;j<list.length;j++){
					// 	this.craftsmanshoption.list.push(list[j])
					// }
					
					this.craftsmanshoption.total = res.count
					this.craftsmanshoption.loading = false
					if(res.shopcount < 1){
						// uni.showToast({title:'您的档案地址服务商家不足1个，已为您展示其他服务商家',icon:'none',duration:2000})
					}
					if(this.craftsmanshoption.page == 1) uni.hideLoading()
					uni.stopPullDownRefresh()
				} catch {
					this.craftsmanshoption.loading = false
					uni.hideLoading()
					uni.stopPullDownRefresh()
				}
			},
			tiaozhuang(status){
				if(status == 1){
					uni.navigateTo({
						url:'/pagesCommodity/findDesign/index'
					})
				}else if(status == 2){
					uni.navigateTo({
						url:'/pagesCommodity/findCraftsman/index'
					})
				}else if(status == 3){
					uni.navigateTo({
						url:'/pagesCommodity/buildingMaterialsCity/index'
					})
				}
				
				
			},
			gotoIndexOne(item,index){
				console.log(item)
				// #ifdef MP-WEIXIN
					if(item.type == 4){
						uni.navigateTo({
							url:'/pages/index1/index1'
						})
					}
				// #endif 
				if(item.type == 5){
					uni.navigateTo({
						url:'/pagesHome/richTextDetails?id='+item.jump_id+'&type='+item.type
					})
				}
			},
			// 获取配置
			async getConfig(){
				try {
					var res = await commonGetConfig({
						field:'have_tell'
					})
					// console.log(res,'have_tell-----------------------------------');
					this.have_tell = res.config;
				} catch {}
			},
			async getConfigIdea(){
				// console.log('-----------------------');
				try {
					var res = await commonGetConfig({
						field:'have_idea'
					})
					// console.log(res,'have_idea-----------------------------------');
					this.have_idea = res.config;
				} catch {}
			},
			
			//故障报修跳转
			onConstructionSite(){
				uni.navigateTo({url:'/pagesMy/feedback/index'})
			},
			
			//访客等级跳转
			onFangketz(){
				uni.navigateTo({url:'/pagesMy/visitorregistration/index'})
			},
			changeIntegral() {
				this.integral.visible = false
				this.$store.commit('setNewUser', 2)
			},
			onDecorationGold(){
				this.integral.visible = false
				this.$store.commit('setNewUser', 2)
				uni.navigateTo({
					url:'/pagesMy/decorationGold/detailed'
				})
			},
			onChat() {
				if (this.$store.getters.userInfo) {
					uni.navigateTo({
						url: '/pagesChat/systemMessage'
					})
				} else {
					this.$global.getUserInfo()
				}
			},
			
			//查询banner图
			async onGetBannerList() {
				try {
					var res = await getHomeCarousel({
						status: 1,
						zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : '',
					})
					this.bannerList = res.map((c, i) => {
						i == 0 ? c.class = 'image1' : i == 1 ? c.class = 'image2' : i == 2 ? c.class =
							'image3' : c.class = ''
						return c
					})
					// this.$store.commit('setHomeBannerList',this.bannerList)
				} catch {}
			},
			async getTellAboutList() {
				try {
					var res = await getHometellAbout({
						page: this.page,
						limit: this.limit,
						zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : '',
					})
					this.tellAboutList = res
					// this.$store.commit('setHomeTellAboutList',this.tellAboutList)
				} catch {
				}
			},
			Designcase() {
				
				//0元抢购
				uni.navigateTo({
					url: `/pagesHome/information?type=newHouseAcceptance`
				});
				//设计案例
				// uni.navigateTo({
				// 	url: `/pagesHome/designCase/index`
				// });
			},
			quickClick(row) {
				uni.navigateTo({
					url: row.url
				});
			},
			gotoPlatform() {
				uni.navigateTo({
					url: '/pagesHome/platform/platform'
				})
			},
			gotoDecorate() {
				uni.navigateTo({
					url: '/pagesHome/decorateProcess/decorateProcess'
				})
			},
			onDesignerInterview(row) {
				uni.navigateTo({
					url: `/pagesHome/designerInterview?id=${row.id}&type=${row.type}`
				})
			},
			onShortVideo(row, index) {
				var pageIndex =  index == 0 ? 1 :  Math.ceil(index / this.findInspiration.limit) 
				uni.navigateTo({
					url: `/pagesHome/shortVideo?id=${row.id }&page=${pageIndex}&size=${this.findInspiration.limit}`
				})
			},
			async getFindInspiration() {
				this.findInspiration.loading = true
				if(this.findInspiration.page == 1) this.findInspiration.heightList =  [0, 0]
				try {
					var res = await getHomeFindInspiration({
						page: this.findInspiration.page,
						limit: this.findInspiration.limit,
						zone_id:this.$store.state.currentArea ? this.$store.state.currentArea.cityId : '',
					})
					if (this.findInspiration.page == 1) {
						this.findInspiration.list = res.list
						setTimeout(() => {
							uni.stopPullDownRefresh()
							// this.findInspiration.loading = false
							this.getDomArea(0)
						}, 300);
					} else {
						this.findInspiration.list = [...this.findInspiration.list, ...res.list]
						setTimeout(() => {
							// this.findInspiration.loading = false
							this.getDomArea( this.findInspiration.page *  this.findInspiration.limit - this.findInspiration.limit)
						}, 300);
					}
					var length = this.findInspiration.length
					this.findInspiration.total = res.count
					
				} catch (err) {
					this.findInspiration.loading = false
				}
			},
			getDomArea(i) {
				if(this.findInspiration.list.length == i) return
				if (!this.findInspiration.list[i].style) this.findInspiration.list[i].style = {}
				let x = Math.min(...this.findInspiration.heightList)
				let y = this.findInspiration.heightList.indexOf(x)
				this.findInspiration.list[i].style.top = x + 'rpx'
				this.findInspiration.list[i].style.left = y  == 0 ? '0rpx' :  '348rpx'
				const query = uni.createSelectorQuery().in(this);
				query.select(`#row_${this.findInspiration.list[i].id}`).boundingClientRect(data => {
				this.findInspiration.heightList[y] = x + Number((data.height * 326 / data.width).toFixed(2)) + 20
					if (i != this.findInspiration.list.length - 1) {
						this.getDomArea(i + 1)
					} else {
						this.findInspiration.loading = false
						this.$forceUpdate()
					}
				}).exec();
			},
			//更新默认小区
			async setUserInfo() {
				
				var res = await setUserInfo({residentialquarters_id:this.residentialquarters_id,residentialquarters_name:this.residentialquarters_name,typeas:1})
				console.log(res,'更新信息')
				this.$store.commit('setUser',res)
				
			},
		},
		onReady() {
			// this.getFindInspiration()
		},
		onLoad(params) {
			// if (!this.$store.state.userInfo && params.invitation_code && params.invitation_code !=
			// 	'null') {
			// 	this.$store.commit('setInvitationCode', params.invitation_code)
			// 	// uni.setStorageSync('TZ_invitation_code', params.invitation_code)
			// } else {
			// 	this.$store.commit('setInvitationCode', null)
			// 	// uni.removeStorageSync('TZ_invitation_code')
			// }
			// uni.getSystemInfo({
			// 	success: (e) => {
			// 		if (e && e.statusBarHeight) this.$store.commit('setStatusBarHeight', e
			// 			.statusBarHeight)
			// 	}
			// })
			// if (this.$store.state.newUser == 1) {
			// 	this.integral.visible = true
			// } else {
			// 	this.integral.visible = false
			// }
			
			console.log(params,'首页获取参数')
			if(params.residentialquarters_id){
				console.log(params,'登录注册2')
				this.residentialquarters_id = params.residentialquarters_id;
				this.residentialquarters_name = params.residentialquarters_name;
				this.setUserInfo();
			}
			
			this.onGetBannerList();
			// this.getTellAboutList();
			this.getConfigIdea();
			this.getConfig();
			if(this.$store.getters.userInfo.house_record == 0){
				// uni.showToast({
				// 	title:'业主认证后可获取公告',
				// 	icon:'error',
				// 	duration:2000
				// })
				this.house_status = 1;
			}else{
				//获取小区公告
				this.getStandard();
			}
			
			
			// this.getTabFindDesignList();
			// this.FindCraftsmanshop();
			// this.onGetBannerLists()//获取建材城分类
			
			//默认选中找设计
			
			// this.changeTabs_xin(1)
		}
	}
</script>

<style lang="scss" scoped>
	
	.xiazx{
		// background: #fff;
		// display: none;
		padding: 10px 16px;
		.row{
			// border-top: 1px solid #dcdcdc;
			padding: 10px 0px;
			.left{
				width: 50%;
				text-align: left;
				font-size: 16px;
				font-weight: 600;
				display: inline-block;
			}.right{
				width: 50%;
				text-align: right;
				font-size: 12px;
				line-height: 18px;
				display: inline-block;
			}
		}
		.imgssname{
			.banner{
				width: 100%;
				height: 420rpx;
				
			}
			.bann2{
				display: flex;
				    justify-content: space-between;
			}
			.kong{
				// margin-right: 20rpx;
			}
			.item{
				width: 262rpx;
				// display: inline-block;
				margin-top: 10rpx;
				margin-left: 10rpx;
				margin-right: 10rpx;
				// flex: 1;
				
			}
			.goods_name{
				font-size: 24rpx;
				white-space: nowrap;
				text-overflow:ellipsis;
				overflow:hidden;
				display: block;
			}
			.jingyan{
				line-height: 12px;
				font-size: 20rpx;
				display: flex;
				justify-content: space-between;
				.congy{
					white-space: nowrap;
					text-overflow:ellipsis;
					overflow:hidden;
					display: inline-block;
					width: 154rpx;
					
				}
				.dianzan{
					
				}
				.dianzanimg{
					width: 20rpx;
					height: 20rpx;
				}
			}
			.imgtil{
				width: 100%;
				height: 330rpx;
				border-radius: 10px;
				box-shadow: 0px 1px 5px #4a4a4a;
			}
		}
	}
	.banner{
		width: 100%;
		height: 182px;
		.swiper_item{
			height: 100%;
		}
	}
	.imagebanner{
		width: 100%;
		height: 182px;
		    border-radius: 20px;
	}
	page {
		background: #efefef54 !important;
	}

	.page {
		width: 100%;
		padding-bottom: 120rpx;
		overflow: hidden;
	}

	.tabber_box .tabber_box_static {
		width: 100%;
		background-color: #fff;
	}

	.tabber_box .tabber_box_flex {
		width: 100%;
		background-color: #fff;
		position: fixed;
		z-index: 999;
		top: 0;
		left: 0;
	}

	.tabber_box_title_static {
		height: 80rpx;
		width: 100%;
		background-color: #fff;
	}

	.tabber_box_title_flex {
		background-color: #fff;
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		z-index: 99;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 42rpx;
		font-family: PingFang SC, PingFang SC-Semibold;
		font-weight: 700;
		text-align: center;
		color: #000000;

		.left {
			margin-top: 4rpx;
			position: absolute;
			left: 58rpx;
			top: 50%;
			transform: translateY(-50%);

			image {
				width: 36rpx;
				height: 36rpx;
			}

			text {
				display: inline-block;
				position: absolute;
				left: 34rpx;
				top: 5px;
				width: 10rpx;
				height: 10rpx;
				background: $theme;
				border-radius: 50%;
			}
		}
	}

	.quick_box1 {
		display: flex;
		padding: 50rpx 38rpx 0;
		box-sizing: border-box;
		width: 100%;
		justify-content: space-between;

		.row {
			width: 326rpx;
			display: flex;
			justify-content: center;
			// justify-content: space-between;
			
			position: relative;
			.left {
				image {
					width: 165px;
					height: 76px;
					position: relative;
				}
			}

			.right {
				margin-left: 20rpx;
				// width: calc(100% - 128rpx);
				display: flex;
				flex-direction: column;
				// align-items: center;
				justify-content: center;
				
				position: absolute;
				top: 40rpx;
				left: 0;

				>text:nth-child(1) {
					font-family: PingFang SC, PingFang SC-Semibold;
					font-weight: 600;
					font-size: 32rpx;
					line-height: 44rpx;
					color: #000000;
				}

				>text:nth-child(2) {
					font-size: 22rpx;
					font-family: PingFang SC, PingFang SC-Medium;
					color: #adadad;
					line-height: 32rpx;
					margin-top: 2rpx;
				}
			}
		}
	}

	.quick_box2 {
		display: flex;
		padding: 62rpx 38rpx 0;
		box-sizing: border-box;
		width: 100%;
		justify-content: space-between;

		.row {
			width: 326rpx;
			display: flex;
			justify-content: space-between;

			image {
				width: 326rpx;
				height: 190rpx;
				border-radius: 20rpx;
			}
		}
	}

	.quick_box3 {
		display: flex;
		padding: 20rpx 38rpx 0;
		box-sizing: border-box;
		width: 100%;
		justify-content: space-between;
		margin-bottom: 20rpx;

		.row {
			flex: 1;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			image {
				width: 110rpx;
				height: 110rpx;
				margin-bottom: 16rpx;

			}

			text {
				color: #000000;
				line-height: 40rpx;
				font-size: 28rpx;
			}
		}
	}

	.tell_about {
		margin-bottom: 77rpx;
		padding: 0 38rpx;
		box-sizing: border-box;

		.list {
			padding-top: 39rpx;
			display: flex;
			flex-wrap: wrap;

			.row {
				width: 326rpx;
				height: 186rpx;
				margin-bottom: 43rpx;
				position: relative;
				border-radius: 20rpx;

				.video {
					width: 326rpx;
					height: 186rpx;
					border-radius: 20rpx;
				}

				&:nth-child(2n + 1) {
					margin-right: 20rpx;
				}

				.title {
					position: absolute;
					left: 0;
					bottom: 0;
					width: 326rpx;
					height: 44rpx;
					background: rgba(0, 0, 0, .3);
					border-radius: 0rpx 0rpx 22rpx 22rpx;
					font-size: 20rpx;
					color: #E6E6E6;
					line-height: 44rpx;
					padding: 0 20rpx;
					box-sizing: border-box;
					white-space: nowrap;
					overflow: hidden;
					text-overflow: ellipsis;
				}

				.icon {
					position: absolute;
					left: 50%;
					top: 50%;
					transform: translate(-50%, -50%);
					width: 44rpx;
					height: 44rpx;

				}
			}
		}
	}

	.row_title {
		display: flex;
		justify-content: center;
		align-items: center;

		.text {
			font-size: 32rpx;
			line-height: 44rpx;
			font-family: PingFang SC, PingFang SC-Semibold;
			font-weight: 600;
			padding: 0 33rpx;
			color: #000000;
		}

		.row {
			width: 35%;
			height: 2rpx;
			background-color: red;
		}

		.row1 {
			background: linear-gradient(60deg, #ffffff 6%, #808080 82%);
		}

		.row2 {
			background: linear-gradient(60deg, #808080 6%, #ffffff 82%, );
		}


	}

	.find_inspiration {
		padding: 0 38rpx;
		width: 100%;
		box-sizing: border-box;

		.list {
			position: relative;
			margin-top: 39rpx;
			// -moz-column-count: 2;
			// -webkit-column-count: 2;
			// column-count: 2;
			// -moz-column-gap: 1em;
			// -webkit-column-gap: 1em;
			// column-gap: 1em;
			// position: relative;
			image {
				display: block;
				will-change: transform;
			}
			.row {
				position: absolute;
				width: 326rpx;
				// margin-top: 1em;
				// -moz-page-break-inside: avoid;
				// -webkit-column-break-inside: avoid;
				// break-inside: avoid;

				.image {
					width: 326rpx;
					height: 326rpx;
					// height: 100%;
					display: block;
					border-radius: 20rpx;
					margin-bottom: 12rpx;
				}

				.img_box {
					width: 326rpx;
					height: auto;
				}

				.name {
					font-size: 24rpx;
					line-height: 34rpx;
					font-family: PingFang SC, PingFang SC-Semibold;
					font-weight: 600;
					text-align: left;
					color: #101010;
					margin-bottom: 10rpx;
					display: block;
					overflow: hidden;
					word-break: break-all;
					text-overflow: ellispsis;
					display: -webkit-box;
					-webkit-line-clamp: 2;
					-webkit-box-orient: vertical;
				}

				.look {
					display: flex;
					justify-content: flex-end;
					align-items: center;
					image {
						width: 28rpx;
						height: 19rpx;
						margin-right: 5rpx;
					}

					text {
						color: #ADADAD;
						font-size: 20rpx;
						line-height: 28rpx;
					}
				}
			}
		}
	}

	.reject_popup2 {
		// background-color: #fff;
		position: relative;
		width: 750rpx;
		height: 730rpx;
		display: flex;
		align-items: flex-start;

		.image {
			width: 750rpx;
			height: 648rpx;
		}

		.icon {
			position: absolute;
			bottom: 0;
			left: 50%;
			transform: translateX(-50%);
			width: 74rpx;
			height: 74rpx;
		}

	}
	.tip_loaidng{
		width: 100%;
		padding: 30rpx 0 ;
		box-sizing: border-box;
		text-align: center;
		font-size: 24rpx;
		color:#666;
	}
</style>



<!-- 找设计模块的 -->
<style lang="scss" scoped>
	.tabber_box .tabber_box_static {
		width: 100%;
		background: #f2f2f2;
	}

	.tabber_box .tabber_box_flex {
		width: 100%;
		background: #f2f2f2;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;
	}

	.tabber_box_title_static {
		height: 80rpx;
		width: 100%;
		background: #f2f2f2;
	}

	.tabber_box_title_flex {
		background: #f2f2f2;
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		z-index: 999999;
		height: 80rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		font-size: 42rpx;
		font-family: PingFang SC, PingFang SC-Semibold;
		font-weight: 700;
		text-align: center;
		color: #000000;
		.left {
			position: absolute;
			left: 58rpx;
			top: 50%;
			transform: translateY(-50%);
			display: flex;
			align-items: center;

			.city {
				font-size: 28rpx;
				font-family: PingFang SC, PingFang SC-Regular;
				font-weight: 400;
				text-align: left;
				color: #26252b;
				max-width: 200rpx;
				white-space:nowrap;
				overflow:hidden;
				text-overflow:ellipsis;
			}

			image {
				width: 24rpx;
				height: 24rpx;
				margin-left: 8rpx;
			}
		}

		text {
			width: 144rpx;
			height: 66rpx;
			font-size: 48rpx;
			font-family: PingFang SC, PingFang SC-Semibold;
			font-weight: 600;
			text-align: left;
			color: #26252b;
		}
	}

	.search {
		width: 100%;
		height: 100rpx;
		// background: #f2f2f2;
		// position: fixed;
		z-index: 9999;
		padding-top: 40rpx;
		padding: 14rpx 0rpx 14rpx;
		box-sizing: border-box;
		
		.search_box{
			position: relative;
		}
		.select_text2{
			width: 100%;
			height: 64rpx;
			background: #ffffff;
			border-radius: 32rpx;
			font-size: 28rpx;
			line-height: 64rpx;
			color:#333;
			text-align: center;
			// padding: 0 26rpx ;
			box-sizing: border-box;
		}
		.select_text1{
			font-size: 28rpx;
			color:#ADADAD;
			position: absolute;
			left: 50%;
			top:50%;
			transform: translate(-50%,-50%);
			display: flex;
			justify-content: center;
			align-items: center;
			image{
				width: 40rpx;
				height: 40rpx;
			}
			
		}
		
	}

	.tab_row {
		padding: 10rpx 0rpx 0;
		// margin-top: 100rpx;
		// background: #f2f2f2;
	}

	.good_list {
		background: #fff; //设置背景 否则会透明
	}

	.homeBox {
		// 对此盒子进行 sticky 粘性定位
		// position: sticky;
		position: fixed;
		z-index: 9;
		background: #fff; //设置背景 否则会透明
		/* #ifdef H5 */
		//粘性定位 在h5下 加 原生头部高度 44px
		top: 44rpx;
		width: 205rpx;
		margin-top: 100rpx;

		/* #endif */
		.tabBox {
			width: 100%;
			margin-left: 18rpx;
			white-space: nowrap;

			// display: none;
			/* #ifdef MP-TOUTIAO */
			/* #endif */
			.tab-item {
				padding: 8rpx 36rpx;
				position: relative;
				display: inline-block;
				text-align: center;
				transition-property: background-color, width;
				background: #f6f7fb;
				border-radius: 30rpx;
			}
		}
	}

	.imgs {
		width: 22rpx;
		height: 22rpx;
		position: fixed;
		z-index: 99;
		top: 60rpx;
		left: 300rpx;
		padding: 0rpx 36rpx;
	}

	.homeBox {
		width: 630rpx;
		z-index: 99;
		margin-left: 10rpx;
		margin-top: 100rpx;
		background: #f2f2f2;
		padding: 30rpx 0rpx;
	}

	// wwl start
	.list_box {
		// margin: 30rpx 36rpx 30rpx;
		min-height: 60vh;
	}
	
	
	
	
	.quick_box{
		display: flex;
		// padding:20rpx 20rpx 0;
		box-sizing: border-box;
		width: 100%;
		justify-content: space-between;
		flex-wrap: wrap;
		.row{
			flex:25%;
			padding-top:48rpx;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			image{
				width: 80rpx;
				height: 80rpx;
				margin-bottom: 24rpx;
				// border-radius: 50%;
				
			}
			text{
				color:#26252B;
				line-height: 36rpx;
				font-size: 26rpx;
			}
		}
	}
	
	.sandaguan{
		display: flex;
		height: 300rpx;
		.guan1{
			flex: 0 0 40%;
			max-width: 40%;
			margin-right: 20rpx;
			height: 106%;
		}
		.guan{
			flex: 0 0 58%;
			max-width: 60%;
			display: flex;
			flex-direction: column;
			.guan2{
				flex: 0 0 50%;
			}
			.guan3{
				flex: 0 0 50%;
				padding-top: 10px;
			}
		}
		.guanimg{
			width: 100%;
			height: 100%;
		}
		.guanimg2{
			width: 100%;
			height: 100%;
		}
	}

	// wwl end
	
	
	.xiaoqugonggao{
		.top{
			width: 100%;
			    height: 30px;
			    padding: 4px 18px;
			    background: #ffffff;
			    /* border-bottom: 1px solid #999; */
			    box-shadow: 0px 2px 5px 1px #e4e4e4;
			    line-height: 30px;
			    margin-bottom: 3px;
			    font-size: 18px;
		}
		
	}
	
	
	// 小区公告
	.list{
		padding:30rpx 32rpx;
		width: 100%;
		box-sizing: border-box;
		.row{
			display: flex;
			justify-content: space-between;
			width:100%;
			padding: 40rpx 0;
			border-bottom: 2rpx solid #d8d8d8;
			.left{
				width: calc(100% - 250rpx);
				view:nth-child(1){
					color:#313236;
					font-size: 32rpx;
					line-height: 44rpx;
					font-weight: 700;
					white-space:nowrap;
					overflow:hidden;
					text-overflow:ellipsis;
					word-break: break-all;
				}
				view:nth-child(2){
					margin-top: 6rpx;
					color:#ADADAD;
					font-size: 24rpx;
					line-height: 34rpx;
					white-space:nowrap;
					overflow:hidden;
					text-overflow:ellipsis;
				}
				view:nth-child(3){
					margin-top: 6rpx;
					color:#ADADAD;
					font-size: 18rpx;
					line-height: 26rpx;
					display: flex;
					align-items: center;
					image{
						width: 28rpx;
						height: 26rpx;
						margin-right: 5rpx;
					}
				}
			}
			.right{
				width: 238rpx;
				height: 128rpx;
				border-radius: 20rpx;
			}
		}
	}
</style>